package model

import (
	com_model "elflog/common/com-model"
)

type AccountMaster struct {
	com_model.Model
	LoginName string `gorm:"column:login_name;type:varchar(50);index;not null"` // 呢称
	Password  string `gorm:"column:password;type:varchar(64);not null"`         // 密码md5
	Salt      string `gorm:"column:salt;type:varchar(8);not null"`              // 盐值
}

func (user AccountMaster) TableName() string {
	return "tb_account_master"
}

type AccountLogger struct {
	com_model.Model
	AccountId         string `gorm:"column:account_id;primary_key;type:char(36)" json:"account_id"`
	Name              string `gorm:"column:name;type:varchar(50);index;not null"`
	MaxSaveCount      int    `gorm:"column:max_save_count;not null"`
	MaxSaveDuration   int    `gorm:"column:max_save_duration;not null"`
	FieldNameStrategy string `json:"field_name_strategy" gorm:"column:field_name_strategy;not null"` // {"trace_id":"traceId"}...
	Key               string `gorm:"column:key;type:varchar(64);unique_index;not null"`
	Secret            string `gorm:"column:secret;type:varchar(64);not null"`
}

func (user AccountLogger) TableName() string {
	return "tb_account_logger"
}
